import LogFactory from "@/log/LogFactory.ts";
import user_icon from "@/assets/user-settings-fill.svg";
import {Input} from "antd";
import RequestHandler from "@/http/RequestHandler.ts";

const {TextArea } = Input

const log = LogFactory.getLogger("RoleComponent")


const RoleComponent = () => {

    // import.meta.env.VITE_REQUEST_COUNT +=1;
    log.debug("RoleComponent render", import.meta.env.VITE_REQUEST_COUNT)
    return (
        <>
            <div>
                <img src={user_icon}/>
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                     className="bi bi-dice-6-fill" viewBox="0 0 16 16">
                    <path
                        d="M3 0a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V3a3 3 0 0 0-3-3zm1 5.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m8 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m1.5 6.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M12 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3M5.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M4 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/>
                </svg>
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="40px"
                     fill="#ff3300">
                    <path
                        d="M480-440q-59 0-99.5-40.5T340-580q0-59 40.5-99.5T480-720q59 0 99.5 40.5T620-580q0 59-40.5 99.5T480-440Zm0-80q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm0 440q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-400Zm0-315-240 90v189q0 54 15 105t41 96q42-21 88-33t96-12q50 0 96 12t88 33q26-45 41-96t15-105v-189l-240-90Zm0 515q-36 0-70 8t-65 22q29 30 63 52t72 34q38-12 72-34t63-52q-31-14-65-22t-70-8Z"/>
                </svg>
                <div>
                    <TextArea cols={5} rows={10} onChange={e => {
                        log.debug("用户输入: ", e.target.value)
                        const data = {key: e.target.value};
                        RequestHandler.post<number>("/manager/admin/security_user/load", data)
                            .then(res => {
                                console.log(res)
                            });
                    }}/>
                </div>
            </div>
        </>
    );
};

export default RoleComponent;